<?php

declare(strict_types=1);

namespace app\home\controller;

use app\BaseController;
use app\category\model\Category;

class Hot extends BaseController
{
    /**
     * 根据二级id查所属的商品信息
     * @return Array
     */
    public function index()
    {
        $DBCategory = new Category();
        // 获取热门商品
        $result = $DBCategory->where('goods_id', '<>', 'null')->field('goods_id,goods_name,goods_picture,goods_discount,goods_price')->select();
        return result($result);
    }
}
